﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ebc.patterns
{
    public class Filter<TInput, TOutput>
    {
        private readonly Func<TInput, TOutput> filterExpression;

        public Filter(Func<TInput, TOutput> filterExpression)
        {
            this.filterExpression = filterExpression;
        }


        public void In_Filter(TInput toBeFiltered)
        {
            this.Out_Filtered(this.filterExpression(toBeFiltered));
        }


        public event Action<TOutput> Out_Filtered;
    }
}
